<?php

class PracticeTestQuestionModel extends CoreModel {

	function __construct()
	{
		parent::__construct();
	}

	public function returnTable()
	{
		return $this->PracticeTestQuestions;
	}

	public function getPracticeTestQuestion($id)
	{
		return $this->wpdb->get_results("SELECT ".$this->PracticeTestQuestions.".* FROM ".$this->PracticeTestQuestions.",".$this->PracticeTestAnswers." WHERE ".$this->PracticeTestAnswers.".question_id=".$this->PracticeTestQuestions.".id AND (".$this->PracticeTestAnswers.".is_answer=1 OR ".$this->PracticeTestAnswers.".is_answer=0) AND ".$this->PracticeTestQuestions.".practice_test_id=".$id." GROUP BY question_id");
	}
}